package com.dungnt.entity;

import java.util.ArrayList;
import java.util.Calendar;

import android.util.Log;

import com.dungnt.vtime.utils.Day;

public class AlarmTime extends BaseTime {
	public static final int ALARM_TYPE_ONCE = 0;
	public static final int ALARM_TYPE_REPEAT = 1;

	// Alarm type (ONCE | REPEAT)
	private int type;
	private ArrayList<Day> frequently = new ArrayList<Day>();
	private int ringtone;
	private String message;

	public AlarmTime(int year, int month, int day, int hour, int minute,
			int second, int type, ArrayList<Day> frequently) {
		super(year, month, day, hour, minute, second);
		this.type = type;
		this.frequently = frequently;
	}

	public AlarmTime() {
		super();
		// TODO Auto-generated constructor stub
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public int getRingtone() {
		return ringtone;
	}

	public void setRingtone(int ringtone) {
		this.ringtone = ringtone;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public ArrayList<Day> getFrequently() {
		return frequently;
	}

	public void setFrequently(ArrayList<Day> frequently) {
		this.frequently = frequently;
	}

	@Override
	public long toMiliseconds() {
		// TODO Auto-generated method stub
		Calendar calendar = Calendar.getInstance();
		Log.d("DungNT", "Alarm time - UTC: " + String.valueOf(calendar.getTimeInMillis()));
		calendar.set(Calendar.HOUR_OF_DAY, getHour());
		Log.d("DungNT", "Alarm time - Hour: " + getHour());
		calendar.set(Calendar.MINUTE, getMinute());
		Log.d("DungNT", "Alarm time - Minute: " + getMinute());
		Log.d("DungNT", "Alarm time - Set Time: " + String.valueOf(calendar.getTimeInMillis()));
		return calendar.getTimeInMillis();
	}

}
